.class public Lmyview/RootScroller;
.super Landroid/widget/ScrollView;
.source "RootScroller.java"


# instance fields
.field private ViewPagerHeight:I

.field private context:Landroid/content/Context;

.field private imgView:Landroid/view/View;

.field private isOne:Z

.field private progressApha:F

.field private screenHeight:I

.field private tittleView:Landroid/view/View;


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 3
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    .line 38
    invoke-direct {p0, p1, p2}, Landroid/widget/ScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 40
    const-string v1, "window"

    invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    .line 39
    check-cast v0, Landroid/view/WindowManager;

    .line 41
    .local v0, "w":Landroid/view/WindowManager;
    invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v1

    invoke-virtual {v1}, Landroid/view/Display;->getHeight()I

    move-result v1

    iput v1, p0, Lmyview/RootScroller;->screenHeight:I

    .line 43
    iput-object p1, p0, Lmyview/RootScroller;->context:Landroid/content/Context;

    .line 45
    invoke-virtual {p0}, Lmyview/RootScroller;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v1

    .line 46
    new-instance v2, Lmyview/RootScroller$1;

    invoke-direct {v2, p0, p1}, Lmyview/RootScroller$1;-><init>(Lmyview/RootScroller;Landroid/content/Context;)V

    .line 45
    invoke-virtual {v1, v2}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

    .line 67
    return-void
.end method

.method static synthetic access$0(Lmyview/RootScroller;)Z
    .locals 1

    .prologue
    .line 32
    iget-boolean v0, p0, Lmyview/RootScroller;->isOne:Z

    return v0
.end method

.method static synthetic access$1(Lmyview/RootScroller;)I
    .locals 1

    .prologue
    .line 20
    iget v0, p0, Lmyview/RootScroller;->screenHeight:I

    return v0
.end method

.method static synthetic access$2(Lmyview/RootScroller;Z)V
    .locals 0

    .prologue
    .line 32
    iput-boolean p1, p0, Lmyview/RootScroller;->isOne:Z

    return-void
.end method

.method private changeAlpha(I)V
    .locals 6
    .param p1, "disY"    # I

    .prologue
    const/4 v5, 0x0

    const/high16 v4, 0x3f800000    # 1.0f

    .line 183
    const-string v1, "huoying"

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "progressApha:"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v3, p0, Lmyview/RootScroller;->progressApha:F

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 184
    if-lez p1, :cond_0

    invoke-virtual {p0}, Lmyview/RootScroller;->getImgViewHeight()I

    move-result v1

    invoke-virtual {p0}, Lmyview/RootScroller;->getTittleViewHeight()I

    move-result v2

    sub-int/2addr v1, v2

    if-ge p1, v1, :cond_0

    .line 185
    int-to-float v1, p1

    iget v2, p0, Lmyview/RootScroller;->progressApha:F

    mul-float/2addr v1, v2

    sub-float v0, v4, v1

    .line 186
    .local v0, "imgViewAlpha":F
    const-string v1, "huoying"

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "imgViewAlpha:"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 187
    sub-float v1, v4, v0

    invoke-direct {p0, v0, v1}, Lmyview/RootScroller;->setAlpha(FF)V

    .line 193
    .end local v0    # "imgViewAlpha":F
    :goto_0
    return-void

    .line 188
    :cond_0
    if-nez p1, :cond_1

    .line 189
    invoke-direct {p0, v4, v5}, Lmyview/RootScroller;->setAlpha(FF)V

    goto :goto_0

    .line 191
    :cond_1
    invoke-direct {p0, v5, v4}, Lmyview/RootScroller;->setAlpha(FF)V

    goto :goto_0
.end method

.method private setAlpha(FF)V
    .locals 1
    .param p1, "imgViewAlpha"    # F
    .param p2, "tittleViewAlpha"    # F

    .prologue
    .line 200
    iget-object v0, p0, Lmyview/RootScroller;->tittleView:Landroid/view/View;

    invoke-static {v0, p2}, Lcom/nineoldandroids/view/ViewHelper;->setAlpha(Landroid/view/View;F)V

    .line 201
    return-void
.end method


# virtual methods
.method public getImgViewHeight()I
    .locals 3

    .prologue
    .line 104
    iget-object v0, p0, Lmyview/RootScroller;->imgView:Landroid/view/View;

    if-nez v0, :cond_0

    .line 105
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v1, "\u5b50view\u4e0d\u80fd\u4e3a\u7a7a"

    invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 107
    :cond_0
    const-string v0, "huoying"

    .line 108
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "imgView.getMeasuredHeight():"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lmyview/RootScroller;->imgView:Landroid/view/View;

    invoke-virtual {v2}, Landroid/view/View;->getMeasuredHeight()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 107
    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 110
    iget-object v0, p0, Lmyview/RootScroller;->imgView:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getMeasuredHeight()I

    move-result v0

    return v0
.end method

.method public getTittleViewHeight()I
    .locals 3

    .prologue
    .line 119
    iget-object v0, p0, Lmyview/RootScroller;->tittleView:Landroid/view/View;

    if-nez v0, :cond_0

    .line 120
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v1, "\u5b50view\u4e0d\u80fd\u4e3a\u7a7a"

    invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 122
    :cond_0
    const-string v0, "huoying"

    .line 123
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "tittleView.getMeasuredHeight():"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lmyview/RootScroller;->tittleView:Landroid/view/View;

    invoke-virtual {v2}, Landroid/view/View;->getHeight()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 122
    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 124
    iget-object v0, p0, Lmyview/RootScroller;->tittleView:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getMeasuredHeight()I

    move-result v0

    return v0
.end method

.method public isInBottom()Z
    .locals 3

    .prologue
    .line 145
    const-string v0, "huoying"

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "getScrollY22():"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Lmyview/RootScroller;->getScrollY()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 146
    invoke-virtual {p0}, Lmyview/RootScroller;->getScrollY()I

    move-result v0

    if-gtz v0, :cond_0

    .line 147
    const/4 v0, 0x1

    .line 149
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public isInTop()Z
    .locals 3

    .prologue
    .line 133
    invoke-virtual {p0}, Lmyview/RootScroller;->getScrollY()I

    move-result v0

    invoke-virtual {p0}, Lmyview/RootScroller;->getImgViewHeight()I

    move-result v1

    invoke-virtual {p0}, Lmyview/RootScroller;->getTittleViewHeight()I

    move-result v2

    sub-int/2addr v1, v2

    if-lt v0, v1, :cond_0

    .line 134
    const/4 v0, 0x1

    .line 136
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 1
    .param p1, "ev"    # Landroid/view/MotionEvent;

    .prologue
    .line 209
    const/4 v0, 0x0

    return v0
.end method

.method protected onLayout(ZIIII)V
    .locals 3
    .param p1, "changed"    # Z
    .param p2, "l"    # I
    .param p3, "t"    # I
    .param p4, "r"    # I
    .param p5, "b"    # I

    .prologue
    const/4 v2, 0x0

    .line 89
    invoke-super/range {p0 .. p5}, Landroid/widget/ScrollView;->onLayout(ZIIII)V

    .line 93
    invoke-virtual {p0}, Lmyview/RootScroller;->getScrollY()I

    move-result v0

    if-lez v0, :cond_0

    iget-object v0, p0, Lmyview/RootScroller;->tittleView:Landroid/view/View;

    invoke-static {v0}, Lcom/nineoldandroids/view/ViewHelper;->getAlpha(Landroid/view/View;)F

    move-result v0

    const/4 v1, 0x0

    cmpg-float v0, v0, v1

    if-gtz v0, :cond_0

    .line 94
    invoke-virtual {p0, v2, v2}, Lmyview/RootScroller;->scrollTo(II)V

    .line 96
    :cond_0
    return-void
.end method

.method protected onSizeChanged(IIII)V
    .locals 3
    .param p1, "w"    # I
    .param p2, "h"    # I
    .param p3, "oldw"    # I
    .param p4, "oldh"    # I

    .prologue
    const/4 v1, 0x0

    .line 78
    invoke-virtual {p0, v1}, Lmyview/RootScroller;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lmyview/RootScroller;->imgView:Landroid/view/View;

    .line 79
    const/high16 v0, 0x3f800000    # 1.0f

    iget-object v1, p0, Lmyview/RootScroller;->imgView:Landroid/view/View;

    invoke-virtual {v1}, Landroid/view/View;->getMeasuredHeight()I

    move-result v1

    int-to-float v1, v1

    div-float/2addr v0, v1

    iput v0, p0, Lmyview/RootScroller;->progressApha:F

    .line 82
    const-string v0, "huoying"

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "getScrollY()"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Lmyview/RootScroller;->getScrollY()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 84
    return-void
.end method

.method public scrollByFather(II)V
    .locals 4
    .param p1, "disX"    # I
    .param p2, "disY"    # I

    .prologue
    const/4 v3, 0x0

    .line 160
    const-string v0, "huoying"

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "disY"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 162
    invoke-virtual {p0, p1, p2}, Lmyview/RootScroller;->scrollBy(II)V

    .line 166
    invoke-virtual {p0}, Lmyview/RootScroller;->getScrollY()I

    move-result v0

    if-gtz v0, :cond_1

    .line 167
    invoke-virtual {p0, v3, v3}, Lmyview/RootScroller;->scrollTo(II)V

    .line 173
    :cond_0
    :goto_0
    invoke-virtual {p0}, Lmyview/RootScroller;->getScrollY()I

    move-result v0

    invoke-direct {p0, v0}, Lmyview/RootScroller;->changeAlpha(I)V

    .line 175
    return-void

    .line 168
    :cond_1
    invoke-virtual {p0}, Lmyview/RootScroller;->getScrollY()I

    move-result v0

    invoke-virtual {p0}, Lmyview/RootScroller;->getImgViewHeight()I

    move-result v1

    invoke-virtual {p0}, Lmyview/RootScroller;->getTittleViewHeight()I

    move-result v2

    sub-int/2addr v1, v2

    if-lt v0, v1, :cond_0

    .line 169
    invoke-virtual {p0}, Lmyview/RootScroller;->getImgViewHeight()I

    move-result v0

    invoke-virtual {p0}, Lmyview/RootScroller;->getTittleViewHeight()I

    move-result v1

    sub-int/2addr v0, v1

    invoke-virtual {p0, v3, v0}, Lmyview/RootScroller;->scrollTo(II)V

    goto :goto_0
.end method

.method public setTittleView(Landroid/view/View;)V
    .locals 0
    .param p1, "tittleView"    # Landroid/view/View;

    .prologue
    .line 29
    iput-object p1, p0, Lmyview/RootScroller;->tittleView:Landroid/view/View;

    .line 30
    return-void
.end method
